package com.ddogring.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ddogring.business.domain.Comment;
import com.ddogring.business.mapper.CommentMapper;
import com.ddogring.business.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: eshop
 * @BelongsPackage: com.ddogring.business.service.impl
 * @Author: DdogRing
 * @CreateTime: 2023-01-30  11:22
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements ICommentService {

    @Autowired
    private CommentMapper commentMapper;

    /**
     * @description: 根据餐品id查询评论
     * @author: DdogRing
     * @date: 2023/2/1 16:28
     * @param: [commodityId]
     * @return: java.util.List<com.ddogring.business.domain.Comment>
     **/
    @Override
    public List<Comment> selectByCommodityId(Integer commodityId) {
        return commentMapper.selectByCommodityId(commodityId);
    }

    /**
     * @description: 单餐品评价列表
     * @author: DdogRing
     * @date: 2023/2/9 17:41
     * @param: [commodityId]
     * @return: java.util.List<com.ddogring.business.domain.Comment>
     **/
    @Override
    public List<Comment> getCommentByCommodityId(Integer commodityId) {
        return commentMapper.getCommentByCommodityId(commodityId);
    }
}
